package service;

import bean.Cls;
import bean.Student;
import bean.Team;
import dao.ClassDao;

import java.util.List;

public class ClassService {
    int n=0;
    ClassDao dao=new ClassDao();


    //增加班级
    public int insertClass(Cls a) {
        int n=dao.insertClass(a);
        return n;
    }

    //查询班级列表
    public List<Cls> selectCls() {
        List<Cls> aList=dao.selectCls();
        return aList;
    }
    //根据名字(模糊)查询班级列表
    public List<Cls> selectClsByName(Cls cls) {
        List<Cls> aList=dao.selectClsByName(cls);
        return aList;
    }
    //增加小组
    public int insertGroup(Team group) {
        int n=dao.insertGroup(group);
        return n;
    }

    //查询小组列表
    public List<Team> selectTeam() {
        List<Team> aList=dao.selectTeam();
        return aList;
    }
    //根据名字(模糊)查询小组列表
    public List<Team> selectTeamByName(Team team) {
        List<Team> aList=dao.selectTeamByName(team);
        return aList;
    }
    //删除小组根据小组ID
    public int deleteTeam(Team team) {
        int n=dao.deleteTeam(team);
        return n;
    }
    //通过名称查询ID
    public Team selectTeamByName2(Team team2) {
        Team aList=dao.selectTeamByName2(team2);
        return aList;
    }
    //添加学生
    public int insertStudent(Student student) {
        int n=dao.insertStudent(student);
        return n;
    }
    //查询学生列表
    public List<Student> selectStudent(Student student) {
        List<Student> aList=dao.selectStudent(student);
        return aList;
    }
    //名字查询学生列表
    public List<Student> selectStudentBysname(Student student) {
        List<Student> aList=dao.selectStudentBysname(student);
        return aList;
    }
    //通过学号查找
    public List<Student> selectStudentBysid(Student student) {
        List<Student> aList=dao.selectStudentBysid(student);
        return aList;
    }
    //通过姓名查找
    public List<Student> selectStudentByall(Student student) {
        List<Student> aList=dao.selectStudentByall(student);
        return aList;
    }
    //随机学生
    public Student selectStudent2(Student student) {
        Student student2=dao.selectStudent2(student);
        return student2;
    }
    //随机小组
    public Team selectGroup(Team team) {
        Team student2=dao.selectGroup(team);
        return student2;
    }
    //根据小组编号随机对应小组成员
    public Student selectStudentByGroup(Student studnet) {
        Student student2=dao.selectStudentByGroup(studnet);
        return student2;
    }
}
